<template>
  <div>
    <h1>{{count}}</h1>
    <Header @count='getCount'/>
    <List @count='getCount' @list='getItem' ref='list'/>
  </div>
</template>

<script>
import List from './components/List.vue'
import Header from './components/Header.vue'
export default {
  name:'App',
  components:{
    List,
    Header
  },
  data(){
    return{
      count:0,
      list:[]
    }
  },
  methods:{
    getCount(count){
      this.count=count
    },
    getItem(item){
      this.list.push(item)
    }
  }
}
</script>

<style>

</style>